  
var gridConfig = function(response){

	var dictList = $.dictionaryUtil.formatArray(response);
	var dictMap =  $.dictionaryUtil.formatMap(response);
	 return {
			/*   data  : data, */
			  operation : ["add","edit","ok","remove","search","reload"],
			  columns :
				[
					/*  {title : "ID",   field : "id"} , */
					 {title : "字段", field : "tableColumn"} ,
					 {title : "字段别名", field : "columnAlias"} ,
					 {title : "表名", field : "tableName"} ,
					 {title : "名字", field : "name",editor:true,width:80} ,
					 {title : "数据类型", field : "dataType",editor:{type:"select",data:dictList["grid_detail_data_type"]}, 
						 formatter : function(cellValue, rowRecord, rowIndex){
		        		 var v =  dictMap["grid_detail_data_type"][cellValue];
		        		 return v || v > 0 ? v: "";
		        	 }} ,  
					 {title : "元素类型", field : "elementType",value:'text',editor:{type:"select",data:dictList["grid_detail_element_type"]}, 
						 formatter : function(cellValue, rowRecord, rowIndex){
		        		 var v =  dictMap["grid_detail_element_type"][cellValue];
		        		 return v || v > 0 ? v: "";
		        	 }} ,  
		    		 {title : "宽度", field : "width",editor:true},
					 {title : "字典编码", field : "dictCode",editor:true} ,
					 {title : "格式化", field : "formatter",editor:true} ,
					 {title : "排序", field : "displaySort",editor:true} ,
					 {title : "显示", field : "isDisplay",value:1,editor:{type:"select",data:dictList["grid_detail_is_display"]},
						 formatter : function(cellValue, options, rowObject){ 
		            		 var v =  dictMap["grid_detail_is_display"][cellValue];
		            		 return v || v > 0 ? v: "";  
		            	 }
					   } , 
					 {title : "对齐", field : "align",value:2,editor:{type:"select",data:dictList["grid_detail_align"]},
						   formatter : function(cellValue, options, rowObject){ 
				            	  var v =  dictMap["grid_detail_align"][cellValue];
				            	  return v || v > 0 ? v: "";  
				            }
					   } ,
					   {title : "sql排序", field : "isSqlSort",value:0,editor:{type:"select",data:dictList["grid_detail_is_sql_sort"]},
						   formatter : function(cellValue, options, rowObject){ 
				            	  var v =   dictMap["grid_detail_is_sql_sort"][cellValue];
				            	  return v || v > 0 ? v: "";  
				            }
					   } ,
					   {title : "sql排序方式", field : "sqlSort",value:0,editor:{type:"select",data:dictList["grid_detail_sort_by"]},
						   formatter : function(cellValue, options, rowObject){ 
				            	  var v =   dictMap["grid_detail_sort_by"][cellValue];
				            	  return v || v > 0 ? v: "";  
				            }
					   } ,
					   {title : "web排序", field : "isWebSort",value:0,editor:{type:"select",data:dictList["grid_detail_is_web_sort"]},
						   formatter : function(cellValue, options, rowObject){ 
				            	  var v =   dictMap["grid_detail_is_web_sort"][cellValue];
				            	  return v || v > 0 ? v: "";  
				            }
					   } ,
					   {title : "web排序方式", field : "align",value:0,editor:{type:"select",data:dictList["grid_detail_sort_by"]},
						   formatter : function(cellValue, options, rowObject){ 
				            	  var v =  dictMap["grid_detail_sort_by"][cellValue];
				            	  return v || v > 0 ? v: "";  
				            }
					   } ,
					   
					   
					   {title : "固定查询", field : "isFixedQuery",value:0,editor:{type:"select",data:dictList["grid_detail_is_fixed_query"]},
						   formatter : function(cellValue, options, rowObject){ 
				            	  var v =  dictMap["grid_detail_is_fixed_query"][cellValue];
				            	  return v || v > 0 ? v: "";  
				            }
					   } ,
					   {title : "高级查询", field : "isDepthQuery",value:0,editor:{type:"select",data:dictList["grid_detail_is_depth_query"]},
						   formatter : function(cellValue, options, rowObject){ 
				            	  var v =   dictMap["grid_detail_is_depth_query"][cellValue];
				            	  return v || v > 0 ? v: "";  
				            }
					   }
			
			    ],
			    onClickRow : function(rowIndex,rowRecord,target){
			    	$("#mytabel").selfgrid("beginEditRow",rowIndex);
			    }
		 };
	 
}


$(function(){
	$.ajax({
		url:"/grid/queryGridUpdate",
		   success:function(response)
		   { 
			   $("#mytabel").selfgrid(gridConfig(response.data)); 
		   }
	}) 
});

  